<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
		    ul{
		    	width: 960px;
		    	margin: 0 auto;
		    }
			ul>li{
				width: 150px;
				height: 150px;
				border: 1px solid #000;
				text-align: center;
				line-height: 150px;
				list-style-type: none;
				float: left;
			}
		</style>
	</head>
	<body>
		<ul>
			<li>1</li>
			<li>2</li>
			<li>3</li>
			<li>4</li>
			<li>5</li>
			<li>6</li>
		</ul>
	</body>
	  <script type="text/javascript">
	  	var li = document.getElementsByTagName('li');
	  	for(var i=0;i<li.length;i++){
	  		var a = parseInt(Math.random()*(255-0+1)+0);
	  		var b = parseInt(Math.random()*(255-0+1)+0);
	  		var c = parseInt(Math.random()*(255-0+1)+0);
	  		li[i].style.background = 'rgb('+a+','+ b+','+c+')';
	  	}
	  </script>
</html>
